import ActionGroup from "./ActionGroup.vue"
import moment from "moment";
/**
 * tooltip {boolean}  
 */
const columns = (showOperate) => {
  let arr = [
    // {
    //   type: 'selection',
    //   width: 55
    // },
    {
      label: 'Driver Number',
      prop: 'drivernumber',
      // width: 160,
      tooltip: false,
    },
    {
      label: 'Driver Name',
      prop: 'name',
      // width: 200,
      tooltip: false,
    },
    {
      label: 'Using Vehicles',
      prop: 'codenumber',
      // minWidth: 156,
      tooltip: false,
    },
    {
      label: 'Gender',
      prop: 'gender',
      width: 150,
      tooltip: false,
    },
    {
      label: 'Age',
      prop: 'age',
      width: 130,
      tooltip: false,
    },
    {
      label: 'Education',
      prop: 'educationName',
      // width: 170,
      tooltip: false,
    },
    {
      label: 'Driving Experience',
      prop: 'experience',
      // width: 220,
      tooltip: false,
    },
    {
      label: 'License Expiration',
      prop: 'licenseexpeirate',
      // width: 180,
      tooltip: false,
      formatter: (row, column, cellValue, index) => {
        return row.licenseexpeirate ? moment(row.licenseexpeirate).format('yyyy-MM-DD') : '';
      }
    },
    {
      label: 'Health',
      prop: 'healthName',
      // width: 140,
      tooltip: false,
    },
  ]
  if (showOperate) {
    arr.push({
      label: "Operate",
      width: 220,
      render: ActionGroup
    })
  }
  return arr;
};
export default columns;